// @import url('~@/components/theme-select/transition.css');

@headerHeight: var(--size-layout-header-height, 52px);
@gap: var(--size-cell-gap, 12px);

// common style ------------------------------------------------------------------

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(@headerHeight + @gap);
}

body {
  margin: 0;
}

p {
  font-size: 14px;
  line-height: 18px;
  margin-block: 4px;
}

a {
  text-decoration: none;
}

// antd fix ------------------------------------------------------------------

.ant-tabs-card.ant-tabs-small > .ant-tabs-nav .ant-tabs-tab {
  padding: 4px @gap;
}

.ant-card {
  .ant-card-head {
    min-height: 40px;
    padding: 0 @gap;
  }

  .ant-card-body {
    padding: @gap;
  }
}

.ant-btn.ant-btn-loading {
  cursor: wait;
}

// 让 switch 更生动
.ant-switch:hover {
  box-shadow: 0 0 0 4px var(--color-border);
}

// #FIXME: 修复弹窗关闭按钮层级设置问题
.ant-modal .ant-modal-close {
  z-index: 1010;
}

// component style ------------------------------------------------------------------

.block-user {
  .block-user-box .block-user-avatar {
    border-radius: var(--size-border-radius-lg, 8px);
  }

  .block-user-menu-panel {
    border-radius: var(--size-border-radius, 6px);
  }
}

.bc-grid {
  width: 100%;
}

.bc-grid-item:nth-last-of-type(1) .ant-form-item {
  margin-right: 0;
}

.grid.grid-tabled {
  background-color: var(--color-bg-component);

  .grid-item {
    padding: 0;
  }

  .data-item-head {
    padding-right: var(--size-cell-gap-sm, 8px);
    text-align: right;
    background-color: var(--color-bg-secondary);
  }

  .ant-row.ant-form-item-row {
    height: 100%;
  }

  .ant-form-item-label,
  .ant-form-item-control {
    padding: var(--size-cell-gap-sm, 8px);
  }

  .ant-form-item-label {
    background-color: var(--color-bg);
  }

  .ant-form-item-control-input + div {
    position: absolute;
    top: 12px;
    right: 18px;
  }
}

.column-2 {
  width: 50%;
  display: inline-block;
}

.column-float-right-top {
  position: absolute;
  top: 0;
  right: var(--size-cell-gap, 16px);
}
